  const state = {
    appleNumer: 0
  }
  const getters = {
    getAppleNumer: state => state.appleNumer
  }
  const actions = {
    fetchAppleNumberByIncrement ({commit, state}) {
      //  调用后台接口
      commit('incrementApple')
      console.log('+' + state.appleNumer)
    },
    fetchAppleNumberByDecrement ({commit, state}) {
      //  调用后台接口
      commit('decrementApple')
      console.log('-' + state.appleNumer)
    }
  }
  const mutations = {
    // 只允许mutations对state进行更改
    incrementApple: state => state.appleNumer++,
    decrementApple: state => state.appleNumer--
  }
  
  export default {
    state,
    getters,
    actions,
    mutations
  }